package com.yd.app.mapper.provider;

import java.util.Map;

/**
 * 评价
 * Created by sunxianhui on 2018/3/7.
 */
public class EvaluateProvider extends BaseProvider {
    /**
     * 获取每一页列表
     * @param map
     * @return
     */
    public String searchEvaluateList(Map map) {
        StringBuilder sb = new StringBuilder("SELECT b.*,u.realName as publishUserName FROM business_evaluate b" +
                " LEFT JOIN sys_user u on b.publishUser = u.id where 1=1 ");
        sb.append(" and b.goodsId=#{goodsId} ");
        sb.append(" limit #{startRow},#{pageSize} ");
        return sb.toString();
    }

    /**
     * 获取查询总数量
     * @param map
     * @return
     */
    public String searchEvaluateCount(Map map) {
        StringBuilder sb = new StringBuilder(" select count(1) from business_evaluate b where 1=1");
        sb.append(" and b.goodsId=#{goodsId} ");
        return sb.toString();
    }

}
